import React, { useEffect, useState } from 'react'
import axios from 'axios'
function App() {
  let [ list,setlist] = useState([])
  let [shopcar,setshopcar] = useState([])
  useEffect(()=>{
    axios.get('http://localhost:3000/posts').then((res)=>{
      setlist(res.data)
    })

    axios.get('http://localhost:3000/list').then((res)=>{
   
    setshopcar(res.data)

    })
  },[])
  return (
    <div>{
      list.map(item=>{
        return <p key={item.id}>{item.title}</p>
      })
    }
    {
      shopcar.map(item=>{
        return <p key={item.id}>{item.title}</p>
      })
    }
    <p>
  
    </p>
    <div></div>
    </div>
  )
}

export default App